using System;
using System.Collections.Generic;
using Abs.Core.Models;
using Abs.Core.DAL.EntityFramework;
using Abs.Core.Models.Booking;
using Abs.Core.Models.Room;
using Abs.Core.Models.User;

namespace Abs.Core.DAL.SetUpDatabase
{
    internal partial class AbsInitializer
    {
        private void InitializeAppointments(IList<User> users, IList<Room> rooms, AbsContext absContext)
        {
            var appointments = new List<Appointment>
                               {
                                   new Appointment
                                   {
                                       UserEmail = users[0].Email,
                                       User = users[0],
                                       RoomId = 1,
                                       Room = rooms[0],
                                       StartTime = DateTime.Parse("2012-01-02 07:00:00"),
                                       EndTime = DateTime.Parse("2012-01-02 08:00:00")
                                   },
                                   new Appointment
                                   {
                                       UserEmail = users[1].Email,
                                       User = users[1],
                                       RoomId = 1,
                                       Room = rooms[0],
                                       StartTime = DateTime.Parse("2012-01-02 08:00:00"),
                                       EndTime = DateTime.Parse("2012-01-02 11:00:00")
                                   }
                               };//end of new List<Appointment>
            appointments.ForEach(appointment => absContext.Appointments.Add(appointment));
            absContext.SaveChanges();
        }//end of private void InitializeAppointments(IList<User> users, IList<Room> rooms, AbsContext absContext)
    }//end of public partial class AbsInitializer
}//end of namespace ABS.DAL